<?php
echo $erreur;
?>

<div id="wrapper-content">
    <table class="titrepage" width="100%">
        <tr>
            <td >Liste des categories</td>
            <td align="right">Total | <?php echo $total ?> </td>
        </tr>
    </table>
     <div align="left" id="ajouter">
        <table>
                <tr>
                    <td><a href="<?php echo site_url('product_admin/add_category') ?>">Ajouter nouveau categorie</a></td>
                    <td><a href="<?php echo site_url('product_admin/list_products') ?>">Liste de produit</a></td>  
            </tr>
       </table>
    </div>
    <table align="center" width="100%" class="list">
    <thead>
            <tr>
                <th>Image</th>
                <th>Nom</th>
                <th colspan="2">Action</th>
            </tr>
        </thead>
        <?php foreach ($query as $aRow): ?>
         <?php
                $image_path = './assets/photos/' . $aRow['img'];
                if ($aRow['img'] != '') {
                    if (file_exists($image_path)) {
                        $image_path = base_url().'assets/photos'.'/' . $aRow['img'];

                    } else {
                        $image_path = root_url('zoo-market').'assets/noimage.gif';
                    }
                } else {
                    $image_path = root_url('zoo-market').'assets/noimage.gif';
                }

        ?>
        <tr>
             <td><a rel="example_group"  href="<?php echo $image_path;?>" title=""><img border="0" alt="" src="<?php echo $image_path;?>" height="60"/></a></td>
            <td ><?php echo $aRow['nomfr']; ?></td>
            <td width="70px" >
            <a  href="<?php echo site_url('product_admin/edit_category') . '/' . $aRow['id']; ?>" ><img border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/modifier.png"/></a>
            </td>
            <td width="70px" >
           <a class="supprimer" href="#" ><img border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/supprimer.png"/></a>
         
                        <div style="display:none">
                                    Confirmer <br/>
                            <a href="<?php echo site_url('product_admin/delete_category') . '/' . $aRow['id'] . '/' . $per_page . '/' . $off_set; ?>"> <img border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/oui.png"/></a>
                    <a class="non" href="#" ><img  border="0"src="<?php echo root_url('zoo-market') . 'assets/admin/' ?>images/non.png"/></a>
                </div>
         </td>      
        </tr>
        <?php endforeach; ?>
            </table>
    <?php echo $pagination; ?>
</div>
